{% extends "base_cn.html" %}
{% block content %}
<script src="/static/javascripts/calendar.js" type="text/javascript"></script>
<script src="/static/javascripts/calendar-zh.js" type="text/javascript"></script>
<script src="/static/javascripts/calendar-setup.js" type="text/javascript"></script>

<script src="/static/javascripts/xms_cn.js" type="text/javascript"></script>

<div style="width:320px">
	<form id="myForm" method="post" action="/additem/">
	<ins>请选择类型:
	<select name="show" onchange="changeView()">
	    <option  {% if additem.showpayout %} selected="selected" {% endif %} value="Payout">支出</option>
	    <option {% if additem.showincome %} selected="selected" {% endif %}  value="Income">收入</option>
  </select></ins>
  </form>  
    <fieldset>
	{% if additem.showpayout %}
		<legend>
			支出
		</legend>
	{% else %}{% if additem.showincome %}
	    <legend>
			收入
		</legend>
	{%endif%}{%endif%}	
		<form id="addform" method="post" action="/additem/" onsubmit="return verifyAddForm()">
     <table>
            <tr valign="middle">
                <td >日期: 
                </td>
                <td >
                </td>
                <td>
                  <input id="date" class="calendar" readonly="readonly" name="date" type="text" value="{% now "Y-m-d" %}"/>
                </td>
            </tr>
            <tr>
                <td >金额: 
                </td>
                <td>
                </td>
                <td >
                    <input id="money" name="money" type="text" />
                </td>
            </tr>
            <tr>
                <td >姓名: 
                </td>
                <td >
                </td>

                <td >
                    <select name="username">
                    {% for user in userlist %}
	    			  <option {%ifequal user selectuser %}selected="selected"{%endifequal%} value="{{user}}">{{user|escape}}</option>
	    			{%endfor%}
  					</select>
                </td>
            </tr>
           <tr>
                <td >备注: 
                </td>
                <td >
                </td>

                <td>
                    <textarea id="description" name="description" rows="5" cols="25"></textarea>
                </td>
            </tr> 
            {% if additem.showpayout %}
           <tr>
                <td > 
                </td>
                <td >
                </td>
                <td>
                    <input name="haspay" type="checkbox"/>已报销?</td>
            </tr>  
            {% endif %}
           <tr>
                <td colspan="3" align="center">
                    <input id="submit" type="submit" value="提交记录" class="MyButton"/>
                    {% if additem.showpayout %}
                    <input type="hidden" name="post" value="post_payout" />
                    {% else %}{% if additem.showincome %} 
                    <input type="hidden" name="post" value="post_income" />
                    {% endif %}	{% endif %}
                </td>
            </tr>  
        </table>
     </form>
	</fieldset>
</div>
<script src="/static/javascripts/enable_cal.js" type="text/javascript">
</script>
{% endblock %}
